<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="com.uc.training.smadmin.bd.dao.LoginLogDao">
	<!--插入登陆日志-->
	<insert id="insertLog" parameterClass="com.uc.training.smadmin.bd.model.LoginLog">
		INSERT INTO
		t_bd_login_log
		(member_id, ip)
		VALUES
		(#memberId#, #ip#)
	</insert>
	<!--会员当天登陆的次数-->
	<select id="queryLoginCount" parameterClass="com.uc.training.smadmin.bd.model.LoginLog" resultClass="java.lang.Integer">
		SELECT
		count(*)
		FROM
		t_bd_login_log
		WHERE
		member_id = #memberId# AND date(create_time) = date(now())
	</select>
</sqlMap>